package com.lzw.blog.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lzw.blog.Service.MessageBoardService;
import com.lzw.blog.dao.mapper.MessageBoardMapper;
import com.lzw.blog.dao.pojo.MessageBoard;
import com.lzw.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageBoardServiceimpl implements MessageBoardService {
    @Autowired
    private MessageBoardMapper messageBoardMapper;

    @Override
    public Result add(MessageBoard messageBoard) {
        System.out.println(messageBoard);
        return Result.success(messageBoardMapper.insert(messageBoard));
    }

    @Override
    public Result select() {
        List<MessageBoard> visiters = messageBoardMapper.selectList(new LambdaQueryWrapper<>());
        return Result.success(visiters);
    }
}
